package com.woniu.dao;

import com.woniu.domain.MapPath;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MapPathDao {
    @ApiOperation(value = "添加学习路径")
    @ApiImplicitParam(name = "mapPath",value = "学习路径对象")
    int addMapPath(MapPath mapPath);

    @ApiOperation(value = "新增 路径课程关系表")
    @ApiImplicitParam(name = "mapPath",value = "学习路径对象")
    int addMapPathExamConnect(MapPath mapPath);

    @ApiOperation(value = "根据路径名查询，避免重复")
    @ApiImplicitParam(name = "pathName",value = "学习路径名")
    MapPath findMapPathAndByName(@Param("pathName") String pathName);

    @ApiOperation(value = "查询所有路径")
    List<MapPath> findAllMapPath();

    @ApiOperation(value = "通过路径id查询对应课程数量，中间表")
    @ApiImplicitParam(name = "refPathId",value = "中间表学习路径id")
    MapPath findMapPathById(@Param("refPathId") Integer refPathId);

    @ApiOperation(value = "批量查询 路径ids")
    @ApiImplicitParam(name = "ids",value = "学习路径id数组")
    List<MapPath> findMapPathByIds(String[] ids);

    /*
     * Description :修改路径表  <br/>
     * ChangeLog : 1. 创建 (2021/6/9 19:51 [zcl]);
     ** @param null
     * *  @return null
    */
    @ApiOperation(value = "通过学习路径id更新数据")
    @ApiImplicitParam(name = "mapPath",value = "学习路径对象")
    int updateMapPathById(MapPath mapPath);

   //修改中间表
   @ApiOperation(value = "修改中间表")
   @ApiImplicitParam(name = "mapPath",value = "学习路径对象")
   int updateMapPathExamConnectById(MapPath mapPath);

    /*
     * Description : 根据学习地图id查询学习路径  <br/>
     * ChangeLog : 1. 创建 (2021/6/9 10:02 [ljy]);
     ** @param mapId  学习地图id
     * *  @return List<MapPath> 学习路径集合
     */
    @ApiOperation(value = "根据学习地图id查询学习路径")
    @ApiImplicitParam(name = "mapId",value = "学习地图id")
    List<MapPath> getMapPathByMapId(@Param("mapId") Integer mapId);

    @ApiOperation(value = "查询路径与课程详情")
    List<MapPath> queryAllMapPath();

    @ApiOperation(value = "条件查询路径与课程详情")
    List<MapPath> cqueryAllMapPath(MapPath mapPath);

    @ApiOperation(value = "逻辑删除路径")
    int delMapPath(@Param("id") Integer id);

}
